//----------------------------------------------------------------------------
//  ,-.
// /_\___ ,   Ninja Framework
// '  ___\    (C) Riccardo Capra - http://riccar.do
//  //   \\
//----------------------------------------------------------------------------
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------------

#ifndef NJ_CONFIGURATION_H
#	define NJ_CONFIGURATION_H

#	include "NjNinjaSyncLib.h"

#	if (!defined(NJ_CONFIGURATION_DEBUG)) && (!defined(NJ_CONFIGURATION_RELEASE)) && (!defined(NJ_CONFIGURATION_SHIPPING))
#		error "Unsupported build configuration"
#	endif

/// \def NJ_PLATFORM_HW_PC
/// \brief Set to 1 if the target hardware is a PC (set to 0 otherwise)

/// \def NJ_PLATFORM_OS_WIN
/// \brief Set to 1 if the target operating system is windows based (set to 0 otherwise)

/// \def NJ_PLATFORM_OS_LINUX
/// \brief Set to 1 if the target operating system is linux based (set to 0 otherwise)

/// \def NJ_PLATFORM_ASM_INTEL_X86
/// \brief Set to 1 if the target architecture is based on Intel x86 (set to 0 otherwise)

/// \def NJ_PLATFORM_ASM_INTEL_X64
/// \brief Set to 1 if the target architecture is based on Intel x64 (set to 0 otherwise)

/// \def NJ_PLATFORM_ASM_ARM_V6K
/// \brief Set to 1 if the target architecture is based on ARMv6k architecture

/// \def NJ_PLATFORM_32_BIT
/// \brief Set to 1 if architecture is 32 bit (set to 0 otherwise)

/// \def NJ_PLATFORM_64_BIT
/// \brief Set to 1 if architecture is 64 bit (set to 0 otherwise)

/// \def NJ_PLATFORM_LITTLE_ENDIAN
/// \brief Set to 1 if architecture is little endian (set to 0 otherwise)

/// \def NJ_PLATFORM_BIG_ENDIAN
/// \brief Set to 1 if architecture is big endian (set to 0 otherwise)

/// \def NJ_COMPILER_TYPE_VC
/// \brief Set to 1 if the compiler is Visual Studio (set to 0 otherwise)

/// \def NJ_COMPILER_VERSION
/// \brief Set to the compiler version

/// \def NJ_COMPILER_CPP11_EXTENSIONS
/// \brief Set to 1 if the compiler supports C++11 extensions (set to 0 otherwise)

/// \def NJ_COMPILER_HAS_INT128
/// \brief Set to 1 if the compiler supports __int128 type (set to 0 otherwise)

/// \def NJ_HIDE_INTELLISENSE
/// \brief Set to 1 if the header is processed by Visual Studio intellisense (set to 0 otherwise)
///
/// This can be used to hide intellisense part of the headers

#	if defined(NJ_PLATFORM_WIN32)
#		define NJ_PLATFORM_HW_PC 1
#		define NJ_PLATFORM_OS_WIN 1
#		define NJ_PLATFORM_ASM_INTEL_X86 1
#		define NJ_PLATFORM_32_BIT 1
#		define NJ_PLATFORM_LITTLE_ENDIAN 1
#	elif defined(NJ_PLATFORM_WIN64)
#		define NJ_PLATFORM_HW_PC 1
#		define NJ_PLATFORM_OS_WIN 1
#		define NJ_PLATFORM_ASM_INTEL_X64 1
#		define NJ_PLATFORM_64_BIT 1
#		define NJ_PLATFORM_LITTLE_ENDIAN 1
#	elif defined(NJ_PLATFORM_LINUX_X86)
#		define NJ_PLATFORM_HW_PC 1
#		define NJ_PLATFORM_OS_LINUX 1
#		define NJ_PLATFORM_ASM_INTEL_X86 1
#		define NJ_PLATFORM_32_BIT 1
#		define NJ_PLATFORM_LITTLE_ENDIAN 1
#	elif defined(NJ_PLATFORM_LINUX_X86_64)
#		define NJ_PLATFORM_HW_PC 1
#		define NJ_PLATFORM_OS_LINUX 1
#		define NJ_PLATFORM_ASM_INTEL_X64 1
#		define NJ_PLATFORM_64_BIT 1
#		define NJ_PLATFORM_LITTLE_ENDIAN 1
#	elif defined(NJ_PLATFORM_LINUX_ARMV6K)
#		define NJ_PLATFORM_HW_PC 1
#		define NJ_PLATFORM_OS_LINUX 1
#		define NJ_PLATFORM_ASM_ARM_V6K 1
#		define NJ_PLATFORM_32_BIT 1
#		define NJ_PLATFORM_LITTLE_ENDIAN 1
#	else
#		error "Unsupported build configuration"
#	endif

#	if NJ_PLATFORM_HW_PC
#	else
#		error "Unsupported build configuration"
#	endif

#	if NJ_PLATFORM_OS_WIN
#		define NJ_PLATFORM_OS_LINUX 0
#	elif NJ_PLATFORM_OS_LINUX
#		define NJ_PLATFORM_OS_WIN 0
#	else
#		error "Unsupported build configuration"
#	endif

#	if NJ_PLATFORM_ASM_INTEL_X86
#		define NJ_PLATFORM_ASM_INTEL_X64 0
#		define NJ_PLATFORM_ASM_ARM_V6K 0
#	elif NJ_PLATFORM_ASM_INTEL_X64
#		define NJ_PLATFORM_ASM_INTEL_X86 0
#		define NJ_PLATFORM_ASM_ARM_V6K 0
#	elif NJ_PLATFORM_ASM_ARM_V6K
#		define NJ_PLATFORM_ASM_INTEL_X86 0
#		define NJ_PLATFORM_ASM_INTEL_X64 0
#	else
#		error "Unsupported build configuration"
#	endif

#	if NJ_PLATFORM_32_BIT
#		define NJ_PLATFORM_64_BIT 0
#	elif NJ_PLATFORM_64_BIT
#		define NJ_PLATFORM_32_BIT 0
#	else
#		error "Unsupported build configuration"
#	endif

#	if NJ_PLATFORM_LITTLE_ENDIAN
#		define NJ_PLATFORM_BIG_ENDIAN 0
#	elif NJ_PLATFORM_BIG_ENDIAN
#		define NJ_PLATFORM_LITTLE_ENDIAN 0
#	else
#		error "Unsupported build configuration"
#	endif

#	if defined(NJ_COMPILER_VC10)
#		define NJ_COMPILER_TYPE_VC 1
#		define NJ_COMPILER_VERSION 10
#		define NJ_COMPILER_HAS_INT128 0
#	elif defined(NJ_COMPILER_VC11)
#		define NJ_COMPILER_TYPE_VC 1
#		define NJ_COMPILER_VERSION 11
#		define NJ_COMPILER_HAS_INT128 0
#	elif defined(NJ_COMPILER_GCC)
#		define NJ_COMPILER_TYPE_GCC 1
#		define NJ_COMPILER_VERSION (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__)
#		define NJ_COMPILER_HAS_INT128 0
#	else
#		error "Unsupported build configuration"
#	endif

#	if NJ_COMPILER_TYPE_VC
#		define NJ_COMPILER_TYPE_GCC 0
#	elif NJ_COMPILER_TYPE_GCC
#		define NJ_COMPILER_TYPE_VC 0
#	else
#		error "Unsupported build configuration"
#	endif

#	if !NJ_COMPILER_TYPE_VC
#		define NJ_HIDE_INTELLISENSE 0
#	elif defined(__INTELLISENSE__)
#		define NJ_HIDE_INTELLISENSE 1
#	else
#		define NJ_HIDE_INTELLISENSE 0
#	endif

#endif // NJ_CONFIGURATION_H
